import { createApp } from 'vue';
import App from './App.vue';
import drag from './directives/drag';
import loading from './directives/loading'
import hasPermission from './directives/permission'
import { buildDirective as HotkeyDirective } from './directives/hotkey'
import router from "./router"

const HotkeyPlugin = {
  install(app, alias = {}) {
    app.provide('hotkey-alias', alias)
    app.directive('hotkey', HotkeyDirective(alias))
  },
}

const app = createApp(App);

app.directive('drag', drag);
app.directive('loading', loading)
app.directive('hasPermission', hasPermission)
app.use(HotkeyPlugin)

app.use(router)

app.mount('#app');
